﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy2_5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            txtInput.Text = "";
            txtResult.Text = "";
        }

        private void btnConfirm_Click(object sender, EventArgs e)
        {
            string input = txtInput.Text;
            string result = "";
            // 使用 switch 结构根据输入的数字确定对应的英文星期
            switch (input)
            {
                case "1":
                    result = "Monday";
                    break;
                case "2":
                    result = "Tuesday";
                    break;
                case "3":
                    result = "Wednesday";
                    break;
                case "4":
                    result = "Thursday";
                    break;
                case "5":
                    result = "Friday";
                    break;
                case "6":
                    result = "Saturday";
                    break;
                case "7":
                    result = "Sunday";
                    break;
                default:
                    // 输入不是 1 - 7 时，弹出提示框
                    MessageBox.Show("请输入数字 1-7！");
                    // 清空结果文本框
                    txtResult.Text = "";
                    return;
            }
            // 将对应的英文星期显示在结果文本框中
            txtResult.Text = result;
        }
    }
}
